package com.lepu.app.fun.chat.bean;

import org.json.JSONException;
import org.json.JSONObject;

import com.google.gson.Gson;
import com.google.gson.reflect.TypeToken;

/**
 * 在线咨询 
 * @author wxd
 *
 */
public class BeanStaffEntity {

	public String Text;
	public String Time;
    
    public static BeanStaffEntity handleContent(String content) {
        try {
            JSONObject jsonOut = new JSONObject(content);
            String data = jsonOut.get("Message").toString();
            
            Gson gson = new Gson();
            BeanStaffEntity staffEntity = gson.fromJson(data,
    				new TypeToken<BeanStaffEntity>() {
    				}.getType());
            
            return staffEntity;
        } catch (JSONException e) {
            e.printStackTrace();
        }
        return null;
    }
    
    public static String getDefaultReceiveData(String content)
    {
    	String data = "";
    	
    	try {
            JSONObject dataObject = new JSONObject();
            dataObject.put("Text", content);
            dataObject.put("Time", "");
            
            JSONObject obj = new JSONObject();
            obj.put("Message", dataObject.toString());
            
            data = obj.toString();
        } catch (JSONException e) {
            e.printStackTrace();
        }
    	return data;
    }
}
